﻿// JScript File

var xmlHttp;
var x ,y;
var _top, _left;

//  netscape compatible !!!
var ns4=(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>3) ? true:false;

if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName=="Netscape") { 
  document.captureEvents(Event.MOUSEDOWN);
 }
}


function remove(obj, sid, pid)
{ 
    xmlHttp=GetXmlHttpObject()
    if (xmlHttp==null)
    {
        alert ("Browser does not support HTTP Request");
        return;
    }
    var url="remove_file.asp";
    url=url+"?filename="+obj.id+"_"+obj.innerHTML.substring(0, obj.innerHTML.indexOf("<")-1);
    url=url+"&sid="+sid;
    url=url+"&pid="+pid;
    //xmlHttp.onreadystatechange=stateChanged;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
}

function stateChanged() 
{ 
    var test = document.getElementById("divTest");    
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    { 
	    // complete delete 1 row
	    
	    test.innerHTML=xmlHttp.responseText;
	    
    } 
    else if(xmlHttp.readyState==1)
    {
	    // loading
    }
} 

function GetXmlHttpObject()
{ 
    var objXMLHttp=null
    if (window.XMLHttpRequest)
    {
        objXMLHttp=new XMLHttpRequest()
    }
    else if (window.ActiveXObject)
    {
        objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
    }
    return objXMLHttp
}